package com.wen.common.base;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 控制层基础类
 * @date 2018年10月30日
 * @author W-L
 */
public abstract class BaseController {

	private final Logger logger = Logger.getLogger(BaseController.class);
	
	/**
	 * 返回jsp路径
	 * @param path
	 * @return
	 */
	public String jsp(String path) {
		return path.concat(".jsp");
	}
	
	@ExceptionHandler
	public String exceptionHandler(HttpServletRequest request,HttpServletResponse response,Exception exception) {
		logger.error("统一异常处理：" + exception);
		return "/error.jsp";
	}
}
